/**
 * Created by win7 on 2017/3/16.
 */
import Relay from "react-relay";

export default class MsLoginMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { msLogin }`;
    }

    getVariables() {
        return {
            argsInput: {
                password: this.props.password,
                phone: this.props.phone,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on  msLoginPayload {
            loginResponse {
                errorCode
                value
                token
                manager{
                    name
                    roleName
                    roleId
                    managerId
                    pid
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on  msLoginPayload {
                    loginResponse {
                        errorCode
                        value
                        token
                        manager{
                            name
                            roleName
                            roleId
                            managerId
                            pid
                        }
                    }
                }
            `]
        }];
    }

}